package com.xiaoxi.common.constant.enumeration.statuscode.user;

import com.xiaoxi.common.constant.enumeration.statuscode.ParentEnum;

import java.util.HashMap;
import java.util.Map;

/**
 * @author xiaoxi
 * @version 1.0
 * @date 2022/5/16 23:48
 */
public enum RegisterUserEnums implements ParentEnum {

    THE_USERNAME_IS_TOO_LONG_OR_TOO_SHORT("A020", "用户名过长或过短"),
    USER_REGISTERED("A021", "用户已注册"),
    PASSWORD_TOO_SIMPLE("A022", "密码过于简单"),
    THE_PASSWORDS_ARE_INCONSISTENT("A023", "两次密码不一致"),
    PLEASE_INPUT_USERNAME("A024", "请输入用户名");

    private final String code;
    private final String message;

    RegisterUserEnums(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }


    @Override
    public Map<String, String> format() {
        Map<String, String> enumData = new HashMap<>();
        enumData.put("code", this.code);
        enumData.put("message", this.message);
        return enumData;
    }
}
